﻿CREATE TABLE [dbo].[ServiceStatus] (
    [Id]            INT           IDENTITY (1, 1) NOT NULL,
    [ReceivedId]    INT           NOT NULL,
    [ServiceName]   VARCHAR (100) NOT NULL,
    [ServiceStatus] VARCHAR (100) NOT NULL,
    [StatusMessage] VARCHAR (MAX) NULL,
    [StatusTime]    DATETIME      NOT NULL,
    CONSTRAINT [PK_ServiceStatus] PRIMARY KEY CLUSTERED ([Id] ASC),
    CONSTRAINT [FK_ServiceStatus_Received] FOREIGN KEY ([ReceivedId]) REFERENCES [dbo].[Received] ([Id]) ON DELETE CASCADE
);

